class Utility::BlockHacker
  GAP_TIME = 3.minutes
  def self.polling_gap(search_type, api_name = nil)
    Sidekiq.redis do |redis|
      worker_count = redis.keys("flowy:create_comment:#{search_type}:*").count
      (GAP_TIME / [Utility.const_get(search_type).active(api_name).count, 1].max) * worker_count
    end
  end

end